/* $RCSFile: ADNDynCampaignactivityitem.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/CRMWrapper3/DynEntities/ADNDynCampaignactivityitem.cs $
 * $log$
 * Revision 6 2010/08/06 19:56:32  christian.surieux
 *   Added Log to All cs files
 */

/* Copyrights Christian Surieux 2010 */
/* Class ADNDynCampaignactivityitem */
/* Date 2010-01-06 16:03:17Z */

using System;
using System.Diagnostics;
using System.Collections;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using CrmSdk;

namespace AddonNice.CRMWrapper
{
    public class ADNDynCampaignactivityitem : DynEntity
    {
        protected class Ftor: DFactor
        {
            public Ftor() : base(CrmStr.campaignactivityitem)
            {}

            public override Type DynType
            { get { return typeof(ADNDynCampaignactivityitem); } }

            public override string DynTypename
            { get { return CrmStr.campaignactivityitem; } }

            public override DynEntity Build()
            {   return new ADNDynCampaignactivityitem();}

            public override DynEntity Build(CRMWrapperBase w, InternalDynamicEntity dEntity, PropertyDescriptorCollection wproperties)
            {   return new ADNDynCampaignactivityitem(w, dEntity, wproperties, null);}

            public override DynEntity Build(CRMWrapperBase w, string PrimaryFieldValue)
            {   return new ADNDynCampaignactivityitem(w,PrimaryFieldValue);}

            public override DynEntity Build(CRMWrapperBase w,Guid PrimaryKeyValue)
            {   return new ADNDynCampaignactivityitem(w,PrimaryKeyValue);}
        }

        static ADNDynCampaignactivityitem(){new Ftor();} 
        
        public override bool HasOwnerProperty
        {
            get { return false; }
        }
        
        public override bool HasOwningBusinessUnitProperty
        { get { return true; } }
        
        public override bool HasPrimaryField
        {
            get
            { return false; }
        }

        public ADNDynCampaignactivityitem() : base() { }
        
        public ADNDynCampaignactivityitem(CRMWrapperBase w,string PrimaryFieldValue)
            : base(w,CrmStr.campaignactivityitem)
        { }
        
        public ADNDynCampaignactivityitem(CRMWrapperBase w,Guid CrmId) : base(w,CrmStr.campaignactivityitem,CrmId) { }
        
        public ADNDynCampaignactivityitem(CRMWrapperBase w,InternalDynamicEntity e) : base(w,CrmStr.campaignactivityitem,e,null,null) { }
        
        public ADNDynCampaignactivityitem(CRMWrapperBase w,InternalDynamicEntity e,PropertyDescriptorCollection prop,InternalColumnSet s) : base(w,CrmStr.campaignactivityitem,e,prop,s) { }
        
        public ADNDynCampaignactivityitem(ResetWrapperHandler fn,string PrimaryFieldValue)
            : base(fn,CrmStr.campaignactivityitem)
        {}
        
        public ADNDynCampaignactivityitem(ResetWrapperHandler fn,Guid CrmId) : base(fn,CrmStr.campaignactivityitem,CrmId) { }
        
        public ADNDynCampaignactivityitem(ResetWrapperHandler fn,InternalDynamicEntity e) : base(fn,CrmStr.campaignactivityitem,e,null,null) { }
        
        public ADNDynCampaignactivityitem(ResetWrapperHandler fn,InternalDynamicEntity e,PropertyDescriptorCollection prop,InternalColumnSet s) : base(fn,CrmStr.campaignactivityitem,e,prop,s) { }

        /* Properties */

        [CrmDynAttribute(CrmStr.campaignactivityitem)]
        public Guid campaignactivityitemid
        {
            get{ return KeyPropertyValue(CrmStr.campaignactivityitemid); }
            set{ AddKeyProperty(CrmStr.campaignactivityitemid,value); }
        }

        protected override void SetCrmIdProperty(Guid crmId)
        {
            if ( !dicProperty.ContainsKey(CrmStr.campaignactivityitemid) || KeyPropertyValue(CrmStr.campaignactivityitemid) != crmId )
                campaignactivityitemid = crmId;
        }
        public override Guid PrimaryKeyGuidValue
        {
            get{ return campaignactivityitemid; }
            set{ campaignactivityitemid = value; }
        }
        [CrmDynAttribute(CrmStr.campaignactivityitem)]
        public Guid campaignactivityid
        {
            get{ return LookupPropertyValue(CrmStr.campaignactivityid); }
            set{ AddLookupProperty(CrmStr.campaignactivityid,CrmStr.campaignactivity,value); }
        }

        [CrmDynAttribute(CrmStr.campaignactivityitem)]
        public Guid itemid
        {
            get{ return UniqueIdentifierPropertyValue(CrmStr.itemid); }
            set{ AddUniqueIdentifierProperty(CrmStr.itemid,value); }
        }

        [CrmDynAttribute(CrmStr.campaignactivityitem)]
        public string itemobjecttypecode
        {
            get{ return EntityNameReferencePropertyValue(CrmStr.itemobjecttypecode); }
            set{ AddEntityNameReferenceProperty(CrmStr.itemobjecttypecode,value); }
        }

        [CrmDynAttribute(CrmStr.campaignactivityitem)]
        public Guid owningbusinessunit
        {
            get{ return UniqueIdentifierPropertyValue(CrmStr.owningbusinessunit); }
            set{ AddUniqueIdentifierProperty(CrmStr.owningbusinessunit,value); }
        }

        [CrmDynAttribute(CrmStr.campaignactivityitem)]
        public Guid owninguser
        {
            get{ return UniqueIdentifierPropertyValue(CrmStr.owninguser); }
            set{ AddUniqueIdentifierProperty(CrmStr.owninguser,value); }
        }
   }
}